@extends('backend::layout')
@section('title',trans($page_title))
@section('content')
    @if(isset($search_tpl))
        {{$search_tpl->render()}}
    @endif
    @component('backend::component.table.table-content')
        @slot('page_title') {{$page_title}} @endslot
        @slot('tools_btn')
            @component('backend::component.form.button')
                @slot('title') 导出会员 @endslot
                @slot('attr') onclick=exportData(this) @endslot
                @slot('color') info @endslot
                @slot('icon') hcl-export @endslot
                @slot('params'){"url":"{{route('b_PlatStats_exportCtUser')}}","method":"post","title":"批量移除","targetData":".id","confirm":"true"} @endslot
            @endcomponent
        @endslot
        @slot('body_content')
            @if($list->isNotEmpty())
                <table class="list table table-bordered table-striped">
                    <thead>
                    <tr>
                        <th>
                            @component('backend::component.checkbox')
                                @slot('name') ids-all @endslot
                            @endcomponent
                        </th>
                        <th>账号</th><th>现金分</th><th>消费积分</th><th>热销区销售额</th><th>特惠区销售额</th>
                        <th>累计充值</th><th>累计提现</th><th>提冲比</th>
                    </tr>
                    </thead>
                    <tbody>
                    @foreach($list as $value)
                        <tr>
                            <td>
                                @component('backend::component.checkbox')
                                    @slot('name') user_id[] @endslot
                                    @slot('class') id @endslot
                                    @slot('value') {{$value->member_id}} @endslot
                                @endcomponent
                            </td>
                            <td>{{$value->user_number}}[{{$value->user->real_name}}][{{$value->user->user_phone}}]</td>
                            <td>{{$value->money1 ?? 0}}</td>
                            <td>{{$value->money2 ?? 0}}</td>
                            <td>{{$value->total_buy1 ?? 0}}</td>
                            <td>{{$value->total_buy2 ?? 0}}</td>
                            <td>{{$value->total_rg ?? 0}}</td>
                            <td>{{$value->total_wd ?? 0}}</td>
                            <td>
                                @if(($value->total_wd ?? 0) == 0)
                                    0
                                @elseif(($value->total_rg ?? 0) == 0)
                                    {{$value->total_wd}}/{{$value->total_rg}}
                                @else
                                    {{($value->total_wd/$value->total_rg)*100}}
                                @endif
                            </td>
                        </tr>
                    @endforeach
                    </tbody>
                </table>
                @slot('list_page')
                    {{$list->appends($search_tpl->getSearchData())->links('backend::public.pagination')}}
                @endslot
            @else
                @component('backend::public.empty_page')
                    @slot('info') 暂时没有信息 @endslot
                @endcomponent
            @endif
        @endslot
    @endcomponent
@endsection